<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>
      ankoder
  </title>
  <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
<style>

</style>
  <script type="text/javascript">
    window.onload = function() {
      settings = {
          tl: { radius: 10 },
          tr: { radius: 10 },
          bl: { radius: 10 },
          br: { radius: 10 },
          antiAlias: true,
          autoPad: true,
          validTags: ["div"]
      }
      var versionBox = new curvyCorners(settings, document.getElementById("version"));
      versionBox.applyCornersToAll();
    }
  </script>

</head>
<body>
<div id="main">

    <h1>ankoder</h1>
    <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/ankoder"; return false'>
      <p>Get Version</p>
      <a href="http://rubyforge.org/projects/ankoder" class="numbers">0.0.4</a>
    </div>

    <h1>&#x2192; &#8216;ankoder&#8217;</h1>


	<h2>What</h2>
	<p>ankoder is a service provided by rorcraft that allows you convert a Video of any format (YouTube's videos,etc) to MPEG4 (AVI/MOV/MP4/MP3/3GP) or FLV file online. And this gem is to provide  the API for you to send request to our video encoding server.</p>
  <h2>Installing</h2>

<pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">ankoder</span></pre>
<h2>The basics</h2>
<p>As this service is still in private beta stage, for every developer start to use this api , have to apply for the private testing account. To apply the testing account, please fill in the form in <a href="http://free.ankoder.com/">http://free.ankoder.com/</a> .</p>
<h2>Demonstration of usage</h2>

<p>After we have approved the application , we will assign the username and password to login the service, for example, api_user as username , and api_passowrd as password.</p>
<h4>Add the following lines to ApplicationController</h4>
<code>
  require "ankoder"
  include Ankoder
</code>
<h4>To create a user session<br />
</h4>
<code>user = Auth.create(&quot;api_user&quot;, &quot;api_password&quot;)</code>

<h4>To list out the available converting profile</h4>
<code>profiles = user.profiles.find(:all)</code>
<h4>To download a video from Youtube</h4>
<code>download = user.downloads.create('url' =&gt;&quot;http://www.youtube.com/watch?v=Sex4w4h7Tqk&quot;) </code>
<h4>To create a job to convert a video file</h4>
<code>convert_job.create(:video_id =&gt;download.id , :profile_id =&gt; profile.id )</code>

<h4>To Get the list of the upload server </h4>
<p><code>api_servers = user.upload.find(:all)</code></p>
<h4>or to get the recommended upload server</h4>
<p><code>api_server = user.upload.find(:first)</code></p>
<h2>Direct Upload Form Example</h2>
<p>the form action can get from <code>user.upload.find(:all)</code></p>
<p>params that accept by ankoder upload api</p>
<p>access_key ( required ) : your own access key</p>
<p>success_redirect ( required ) : url that will redirect to if the upload is successful</p>

<p>failed_redirect ( required ) : url that will redirect to if the upload is failed</p>

<p>postback_url ( optional ) : our server will send out the direct postback to you contain the id of the upload video </p>
<p>You can also add some custom params that if you want us to postback to you, as this kind of message will be using your private key to hash , so that you can sure that the message is issued by ankoder.</p>
<p>Params that begin with custom_ will be conside as your custom param.</p>
<p>for the file name field , you have to use the below format</p>

<p>
  <!-- <code><pre><input class="text" id="uploaded_data" name="file[merb_uploaded_data]" size="30" type="file" /></pre></code> -->
  <code>&lt;input class=&quot;text&quot; id=&quot;uploaded_data&quot; name=&quot;file[uploaded_data]&quot; size=&quot;30&quot; type=&quot;file&quot; /&gt;</code></p>
<p>Below is the demo of the upload form structure</p>
<code><pre>
  &lt;h1&gt;Upload a file&lt;/h1&gt;<br />
    &lt;form action=&quot;http://ec2-api.ankoder.com/files/upload&quot; enctype=&quot;multipart/form-data&quot; method=&quot;post&quot;&gt;<br />

    &lt;input name=&quot;success_redirect&quot; type=&quot;hidden&quot; value=&quot;http://www.youhost.com/uplaod_success&quot; /&gt;<br />
    &lt;input name=&quot;failed_redirect&quot; type=&quot;hidden&quot; value=&quot;http://www.youhost.com/uplaod_failed&quot; /&gt;<br />

    &lt;input name=&quot;access_key&quot; type=&quot;hidden&quot; value=&quot;your_access_key&quot; /&gt;<br />
    &lt;input name=&quot;postback_url&quot; type=&quot;hidden&quot; value=&quot;http://www.youhost.com/postback/upload&quot; /&gt;<br />

    &lt;input name=&quot;custom_video_name&quot; type=&quot;hidden&quot; value=&quot;test.mp4&quot; /&gt;<br />
    &lt;input name=&quot;custom_video_format&quot; type=&quot;hidden&quot; value=&quot;mp4&quot; /&gt;</p>

  <p>&lt;p&gt;&lt;label for=&quot;file_uploaded_data&quot;&gt;File&lt;/label&gt;<br />
  &lt;input  name=&quot;file[uploaded_data]&quot; size=&quot;30&quot; type=&quot;file&quot; /&gt;<br />

  &lt;/p&gt;<br />
  &lt;input  name=&quot;commit&quot; type=&quot;submit&quot; value=&quot;Upload&quot; /&gt;<br />
  &lt;/form&gt;

  </p>
  </pre>
</code>
<h2>Forum</h2>

<p><a href="http://groups.google.com/group/ankoder">http://groups.google.com/group/ankoder</a></p>
	<h2>Our development Blog</h2>
	<p><a href="http://devblog.rorcraft.com/">http://devblog.rorcraft.com/</a></p>

  <h2>How to submit patches</h2>


	<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people&#8217;s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>


	<p>The trunk repository is <code>svn://rubyforge.org/var/svn/ankoder/trunk</code> for anonymous access.</p>


	<h2>License</h2>


	<p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>


	<h2>Contact</h2>


	<p>Comments are welcome. Send an email to <a href="mailto:info@rorcraft.com">info@rorcraft.com</a></span> or via the <a href="http://groups.google.com/group/ankoder">forum</a></p>
    <p class="coda">
      <a href="FIXME email"></a>Ankoder, a service by RoRCraft Limited,<br />

      Last Updated : 
      1st April 2008<br>

  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a> </p>
</div>

<!-- insert site tracking codes here, like Google Urchin -->

</body>
</html>
